#pragma once
#include "IMenuState.h"
#include "../SGD Wrappers/SGD_Handle.h"
#include "../SGD Wrappers/SGD_Geometry.h"

class CCharSelect :
	public CIMenuState
{
	CCharSelect() = default;
	~CCharSelect() = default;

	CCharSelect(const CCharSelect&) = delete;
	CCharSelect& operator= (const CCharSelect&) = delete;
	SGD::HTexture ballp1;
	SGD::HTexture ballp2;
	SGD::HTexture ballp3;
	SGD::HTexture ballp4;
	SGD::HTexture characters;
	
	SGD::Point m_ptPosition1 = { 0, 0 };
	SGD::Vector	m_vtVelocity1 = { 0, 0 };

	SGD::Point m_ptPosition2 = { 700, 0 };
	SGD::Vector	m_vtVelocity2 = { 0, 0 };

	SGD::Point m_ptPosition3 = { 0, 500 };
	SGD::Vector	m_vtVelocity3 = { 0, 0 };

	SGD::Point m_ptPosition4 = { 700, 500 };
	SGD::Vector	m_vtVelocity4 = { 0, 0 };

	SGD::Rectangle Runner = { 30, 100, 150, 250 };
	SGD::Rectangle Bomber = { 230, 100, 350, 250 };
	SGD::Rectangle Striker = { 430, 100, 550, 250 };
	SGD::Rectangle Tank = { 630, 100, 750, 250 };

	SGD::Rectangle Player1Red = { 90, 554, 150, 590 };	
	SGD::Rectangle Player1Blue = { 30, 554, 85, 590 };

	SGD::Rectangle Player2Red = {   290, 554, 350, 590};
	SGD::Rectangle Player2Blue = { 	230, 554, 285, 590};

	SGD::Rectangle Player3Red = {  490, 554, 550, 590};	
	SGD::Rectangle Player3Blue = {430, 554, 485, 590 };

	SGD::Rectangle Player4Red = { 690, 554, 750, 590 };	
	SGD::Rectangle Player4Blue = { 630, 554, 685, 590 };

	//what class do they choose?
	// 1 - Runner
	// 2 - Bomber
	// 3 - Striker
	// 4 - Tank


	unsigned int m_uPlayer1 = 1;
	bool m_bPlayer1Team = true;
	bool m_bReady1 = false;

	unsigned int m_uPlayer2 = 2;
	bool m_bPlayer2Team = true;
	bool m_bReady2 = false;

	unsigned int m_uPlayer3 = 3;
	bool m_bPlayer3Team = false;
	bool m_bReady3 = false;

	unsigned int m_uPlayer4 = 4;
	bool m_bPlayer4Team = false;
	bool m_bReady4 = false;

	int m_nRedTeam = 2;
	int m_nBlueTeam = 2;

public:
	static  CCharSelect* GetInstance(void);

	virtual void Enter(void);
	virtual void Exit(void);

	virtual bool Input(void);
	virtual void Update(float elapsedTime);
	virtual void Render(void);

	bool IsOnTeam(int player, bool team, int character);
	void KeepInWorld();

};

